package com.xinz.dao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.code.morphia.Datastore;
import com.xinz.model.Player;

public class PlayerDao extends BaseDao<Player>{

	private static final Logger log = LoggerFactory.getLogger(PlayerDao.class);
	
	/**
	 * 获取玩家信息
	 * @param id
	 * @return
	 */
	public Player getPlayer(final String id) {
		final Datastore datastore = DBManager.getDatastore(DB_MASTER);
		
		Player player = null;
		try {
			player = datastore.get(Player.class, id);
		}
		catch(Exception e) {
			log.error("load player exception,id = " + id, e);
		}
		return player;
	}
	
}
